package com.digitalchina.lxnsy.api;

import android.app.Activity;
import android.os.Handler;

import com.digitalchina.lxnsy.constant.MSG;
import com.digitalchina.lxnsy.constant.URL;
import com.digitalchina.lxnsy.toolkit.OkHttpUtil;
import com.lzy.okhttputils.model.HttpParams;

/**
 * ================================================
 * 项目名称：BigData
 * 类描述：
 * 包名：com.digitalchina.bigdata.api
 * 创建人：郑皓
 * 创建时间：2018/11/9 19:32
 * 修改备注：
 * ================================================
 */
public class BusinessStatistics {

    /**
     * 统计
     *
     * @param activity
     * @param type 1=活动  2=资讯 3=共享
     * @param id
     * @param handler
     */
    public static void browseStatistics(Activity activity, String type, String id, Handler handler) {

        HttpParams params = new HttpParams();
        params.put("id", id);

        String url = "";
        switch (type) {
            case "1":
                url = URL.URL_BROWSE_ACTIVITY;
                break;
            case "2":
                url = URL.URL_BROWSE_SERVICEINFO;
                break;
            case "3":
                url = URL.URL_BROWSE_PRODUCT;
                break;
        }


        OkHttpUtil.post(activity, url, "", params, handler,
                MSG.MSG_BROWSE_SUCCESS, MSG.MSG_BROWSE_FIELD);

    }
}
